<template>
  <div>
    <div class="slogan">This is an home page</div>
    <div class="block" @click="handleClick">block</div>
    <div class="post-btn" @click="handleApi">请求</div>
  </div>
</template>

<script>
import { getTest } from "../api/test.js";

export default {
  name: "Home",
  data: function () {
    return {};
  },
  methods: {
    handleClick(e) {
      console.log(e);
    },
    handleApi() {
      console.log("api test");
      getTest("/test", {
        u: "xxxx",
        p: "zzzzz123",
      }).then((res) => {
        console.log(res);
      });
    },
  },
};
</script>

<style scoped lang="less">
.slogan {
  text-align: center;
  font-size: 20px;
}
.block {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 375px;
  height: 400px;
  background-color: #000;
  color: #fff;
  font-size: 30px;
}

.post-btn {
  width: 200px;
  height: 100px;
  border: 1px solid #ccc;
  line-height: 100px;
  text-align: center;
}
</style>
